package cn.itcast.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.itcast.dao.CustomerMapper;
import cn.itcast.dao.DictMapper;
import cn.itcast.pojo.BaseDict;
import cn.itcast.pojo.Customer;
import cn.itcast.pojo.QueryVo;

@Service
public class CustomerServiceImpl implements CustomerService{
	
	@Resource
	DictMapper dictMapper;
	@Resource
	CustomerMapper customerMapper;
	
	@Override
	public List<BaseDict> findDictByTypeCode(String typeCode) {
		// TODO Auto-generated method stub
		List<BaseDict> list = dictMapper.findDictByTypeCode(typeCode);
		return list;
	}

	@Override
	public List<Customer> findCustomerList(QueryVo queryVo) {
		// TODO Auto-generated method stub
		List<Customer> customerList = customerMapper.findCustomerList(queryVo);
		return customerList;
	}

	@Override
	public Integer findCustomerCount(QueryVo queryVo) {

		Integer customerCount = customerMapper.findCustomerCount(queryVo);
		return customerCount;
	}

	@Override
	public Integer deleteCustomerById(Integer id) {
		// TODO Auto-generated method stub
		Integer count = customerMapper.deleteCustomerById(id);
		return count;
	}

	@Override
	public Customer findCustomerById(Integer id) {
		// TODO Auto-generated method stub
		Customer customer = customerMapper.findCustomerById(id);
		return null;
	}

	@Override
	public Integer updateCustomer(Customer customer) {
		// TODO Auto-generated method stub
		Integer updateCount = customerMapper.updateCustomer(customer);
		return updateCount;
	}
	
}
